<template>
	<om-addpage :busCode="busCode" :saveBtnText='"确定"'  :menuName="menuName" @formSubmit="formSubmit" :showHistoryBtn="false">
		<om-autoform ref="autoform" :initConfigData="initConfigData" :initValue="initValue"></om-autoform>
	</om-addpage>
</template>

<script>
	import {
		errorModal,
		ignoreHtml,
		getUrl,
		confirmModal,
		ptFloat,
		minusF
	} from '@/static/js/common.js';
	import {
		buildFormData,
		formValidation,
		tranferToEditors,
		changeEditor,
		setSubmitSubValue,
		configSelectData,
		hasValue,
		formShowLoading,
		getFormFields,
		formModelLoad,
		getWorkCacheKey
	} from '@/static/js/formUtil.js';
	import urlUtil from '@/static/js/urlUtil.js';
	import { mapState } from 'pinia';
	import {useLoginUserStore} from '@/stores/login-user.js';
	export default {
		provide() {
			return {
				formPage: this
			};
		},
		data() {
			return buildFormData({
				initValue:{
					returnDate:''
				},
				initConfigData: [{
					key: "title0",
					editors: [
						// {
						// 	checkedit: null,
						// 	editReadonly: null,
						// 	isfull: null,
						// 	link: "",
						// 	linkParam: {},
						// 	max: "",
						// 	min: "",
						// 	nameField: "userName",
						// 	prompt: "请选择",
						// 	required: true,
						// 	title: "接受库管员",
						// 	type: "linkbox",
						// 	valueField: "userId",
						// },
						{
							checkedit: null,
							editReadonly: null,
							isfull: null,
							max: "",
							min: "",
							nameField: "returnDate",
							prompt: "请选择",
							required: true,
							title: "延期退还日期",
							type: "datebox",
							valueField: "returnDate",
							onSelect: "timeSelect"
						}
					]
				}]
			})
		},
		computed: {
			...mapState(useLoginUserStore, ['userName', 'userId'])
		},
		methods: {
			formSubmit(){
				let _that = this
				uni.$emit('returnTime', _that.returnDate)
				uni.navigateBack()
			},
			timeSelect(val){
				let _that = this
				_that.returnDate = val
			}
		},
		onLoad(options) {
			
		},
		onShow() {
			
		}
	}
</script>

<style>
</style>
